const mongoose = require('mongoose');

mongoose.connect('mongodb://127.0.0.1/tkTest');
const db = mongoose.connection;

db.on('error', console.error.bind(console, '数据库 连接错误：'));

db.once('open', function () {
    console.log("数据库 已连接");
});

module.exports = mongoose;